<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Whisper: CRiffWaveWriter Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Whisper
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">CRiffWaveWriter Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="CRiffWaveWriter" -->
<p><code>#include &lt;<a class="el" href="riff__wave__writer_8h_source.html">riff_wave_writer.h</a>&gt;</code></p>

<p><a href="classCRiffWaveWriter-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structCRiffWaveWriter_1_1SDataChunk.html">SDataChunk</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structCRiffWaveWriter_1_1SFormatChunk.html">SFormatChunk</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#aa53741b339e618387b8f763cfad3d521">CRiffWaveWriter</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#ae0a0d8ebe1dacf1693e010d048b60bb1">~CRiffWaveWriter</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a9df878bb108ed772c51d86f9bd7623d5">create</a> (std::string pFilename, <a class="el" href="namespaceNWaveFormatTag.html#a984a591ddf2ea06019b5881d5b83364d">NWaveFormatTag::EFormatTag</a> pFormatTag, uint16_t pChannels, uint32_t pSamplesPerSecond, uint16_t pBitsPerSample, bool pOverwrite)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a7a7346ea4390c7c1d47de30a9d77daf1">close</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a96ca87814699a4fedb3788aff1d7f344">sync</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a45143c51ce3291bbcd28b4f50bd75ebf">getWaveInfo</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#ac1cb8527f81dfc4bc8d9fd687b598b65">sampleCount</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#aa92494e4e8aa940c690547a5d146bb0a">channels</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a5074261cb6ae4a1e9a8b401a4045328e">bytePerSample</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#aaa2ebde31d156e23ea6f1b4ad3202c27">writeSamples</a> (void *pSamples, unsigned int pCount)</td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a15cbe18ad4bc7cf8857aa038c633e919">writeChunks</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::ofstream&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a442fa1e496142cb99c240a6e21ff3fff">mWav</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a3ee71d7cc7e9cadc91440d38b21f0423">mRiffChunksize</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <br class="typebreak"/>
<a class="el" href="structCRiffWaveWriter_1_1SFormatChunk.html">CRiffWaveWriter::SFormatChunk</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a46a1d2c07c8488ef3de12a6baf46ae62">mFormat</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structCRiffWaveWriter_1_1SDataChunk.html">CRiffWaveWriter::SDataChunk</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCRiffWaveWriter.html#a97db304507830c6f38da38d431b102ca">mData</a></td></tr>
</table>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="aa53741b339e618387b8f763cfad3d521"></a><!-- doxytag: member="CRiffWaveWriter::CRiffWaveWriter" ref="aa53741b339e618387b8f763cfad3d521" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CRiffWaveWriter::CRiffWaveWriter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ae0a0d8ebe1dacf1693e010d048b60bb1"></a><!-- doxytag: member="CRiffWaveWriter::~CRiffWaveWriter" ref="ae0a0d8ebe1dacf1693e010d048b60bb1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CRiffWaveWriter::~CRiffWaveWriter </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5074261cb6ae4a1e9a8b401a4045328e"></a><!-- doxytag: member="CRiffWaveWriter::bytePerSample" ref="a5074261cb6ae4a1e9a8b401a4045328e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CRiffWaveWriter::bytePerSample </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Alignment of one sample. </p>

</div>
</div>
<a class="anchor" id="aa92494e4e8aa940c690547a5d146bb0a"></a><!-- doxytag: member="CRiffWaveWriter::channels" ref="aa92494e4e8aa940c690547a5d146bb0a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CRiffWaveWriter::channels </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get number of channels. Would be return 1 for mono and 2 for stereo.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Number of channels. </dd></dl>

</div>
</div>
<a class="anchor" id="a7a7346ea4390c7c1d47de30a9d77daf1"></a><!-- doxytag: member="CRiffWaveWriter::close" ref="a7a7346ea4390c7c1d47de30a9d77daf1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CRiffWaveWriter::close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Close wav file.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>True for success. </dd></dl>

</div>
</div>
<a class="anchor" id="a9df878bb108ed772c51d86f9bd7623d5"></a><!-- doxytag: member="CRiffWaveWriter::create" ref="a9df878bb108ed772c51d86f9bd7623d5" args="(std::string pFilename, NWaveFormatTag::EFormatTag pFormatTag, uint16_t pChannels, uint32_t pSamplesPerSecond, uint16_t pBitsPerSample, bool pOverwrite)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CRiffWaveWriter::create </td>
          <td>(</td>
          <td class="paramtype">std::string&#160;</td>
          <td class="paramname"><em>pFilename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceNWaveFormatTag.html#a984a591ddf2ea06019b5881d5b83364d">NWaveFormatTag::EFormatTag</a>&#160;</td>
          <td class="paramname"><em>pFormatTag</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>pChannels</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pSamplesPerSecond</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>pBitsPerSample</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>pOverwrite</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Create a new RIFF WAVE file. If the wav file already exist and pOverwrite is false then the methode create will fail. If pOverwrite is true then a existing wav file will be erased.</p>
<p>blockAlign = pChannels * ((pBitsPerSample + 7) / 8) </p>

</div>
</div>
<a class="anchor" id="a45143c51ce3291bbcd28b4f50bd75ebf"></a><!-- doxytag: member="CRiffWaveWriter::getWaveInfo" ref="a45143c51ce3291bbcd28b4f50bd75ebf" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string CRiffWaveWriter::getWaveInfo </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Get information about the opened wav file.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>String which contains the infos. </dd></dl>

</div>
</div>
<a class="anchor" id="ac1cb8527f81dfc4bc8d9fd687b598b65"></a><!-- doxytag: member="CRiffWaveWriter::sampleCount" ref="ac1cb8527f81dfc4bc8d9fd687b598b65" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CRiffWaveWriter::sampleCount </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return count of samples. If the wave file has two channels then the value is the count of both channels.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Count of samples from all channels </dd></dl>

</div>
</div>
<a class="anchor" id="a96ca87814699a4fedb3788aff1d7f344"></a><!-- doxytag: member="CRiffWaveWriter::sync" ref="a96ca87814699a4fedb3788aff1d7f344" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CRiffWaveWriter::sync </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Save the correct chunk size for the RIFF chunk and data chunk to the wav file. </p>

</div>
</div>
<a class="anchor" id="a15cbe18ad4bc7cf8857aa038c633e919"></a><!-- doxytag: member="CRiffWaveWriter::writeChunks" ref="a15cbe18ad4bc7cf8857aa038c633e919" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool CRiffWaveWriter::writeChunks </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="aaa2ebde31d156e23ea6f1b4ad3202c27"></a><!-- doxytag: member="CRiffWaveWriter::writeSamples" ref="aaa2ebde31d156e23ea6f1b4ad3202c27" args="(void *pSamples, unsigned int pCount)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int CRiffWaveWriter::writeSamples </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>pSamples</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>pCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write a count of samples into the wav file. If the wav file has to channels then the samples must be ordered like CH1, CH2, CH1, CH2, CH1, ... and so on.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pSamples</td><td>Array for samples which should be written. </td></tr>
    <tr><td class="paramname">pCount</td><td>Count of samples (unit: 1 sample). </td></tr>
    <tr><td class="paramname">pCount</td><td>Count of samples which should be written (unit: 1 sample). Array pSamples must has a least pCount elements. One element is equal one sample and must have the size of <a class="el" href="classCRiffWaveWriter.html#a5074261cb6ae4a1e9a8b401a4045328e">bytePerSample()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Count of written samples. </dd></dl>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a97db304507830c6f38da38d431b102ca"></a><!-- doxytag: member="CRiffWaveWriter::mData" ref="a97db304507830c6f38da38d431b102ca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structCRiffWaveWriter_1_1SDataChunk.html">CRiffWaveWriter::SDataChunk</a>  <a class="el" href="classCRiffWaveWriter.html#a97db304507830c6f38da38d431b102ca">CRiffWaveWriter::mData</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a46a1d2c07c8488ef3de12a6baf46ae62"></a><!-- doxytag: member="CRiffWaveWriter::mFormat" ref="a46a1d2c07c8488ef3de12a6baf46ae62" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structCRiffWaveWriter_1_1SFormatChunk.html">CRiffWaveWriter::SFormatChunk</a>  <a class="el" href="classCRiffWaveWriter.html#a46a1d2c07c8488ef3de12a6baf46ae62">CRiffWaveWriter::mFormat</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a3ee71d7cc7e9cadc91440d38b21f0423"></a><!-- doxytag: member="CRiffWaveWriter::mRiffChunksize" ref="a3ee71d7cc7e9cadc91440d38b21f0423" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t <a class="el" href="classCRiffWaveWriter.html#a3ee71d7cc7e9cadc91440d38b21f0423">CRiffWaveWriter::mRiffChunksize</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a442fa1e496142cb99c240a6e21ff3fff"></a><!-- doxytag: member="CRiffWaveWriter::mWav" ref="a442fa1e496142cb99c240a6e21ff3fff" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::ofstream <a class="el" href="classCRiffWaveWriter.html#a442fa1e496142cb99c240a6e21ff3fff">CRiffWaveWriter::mWav</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="riff__wave__writer_8h_source.html">riff_wave_writer.h</a></li>
<li><a class="el" href="riff__wave__writer_8cxx.html">riff_wave_writer.cxx</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Wed Jan 25 2012 22:00:45 for Whisper by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
